package com.tengju.motivation.domain.model.activity;

public enum ActivityTargetGrowType {

    GIFT_PACK(10, "礼包升级"),
    V_INTEGRAL(20, "v力值升级");

    private final Integer val;
    private final String desc;

    public Integer getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    ActivityTargetGrowType(Integer val, String desc) {
        this.val = val;
        this.desc = desc;
    }

    public static ActivityTargetGrowType fromVal(Integer val) {
        for (ActivityTargetGrowType type : values()) {
            if (type.val.equals(val)) {
                return type;
            }
        }
        return null;
    }

    public static ActivityTargetGrowType fromName(String name) {
        for (ActivityTargetGrowType type : values()) {
            if (type.name().equals(name)) {
                return type;
            }
        }
        return null;
    }

}
